<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php /** @var $this Mage_Sales_Block_Order_Info */ ?>
<?php $_order = $this->getOrder();//Zend_Debug::dump($_order->getData()); ?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div class="page-title title-buttons">
    <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
    <?php echo $this->getChildHtml('buttons') ?>
</div>
<?php echo $this->getStatusHistoryRssUrl($_order) ?>
<dl class="order-info">
    <dt><?php echo $this->__('About This Order:') ?></dt>
    <dd>
        <?php $_links = $this->getLinks(); ?>
        <ul id="order-info-tabs">
        <?php foreach ($_links as $_link): ?>
            <?php if($_link->getUrl()): ?>
                <li><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
            <?php else: ?>
                <li class="current"><?php echo $_link->getLabel() ?></li>
            <?php endif; ?>
        <?php endforeach; ?>
        </ul>
        <script type="text/javascript">decorateGeneric($('order-info-tabs').select('LI'),['first','last']);</script>
    </dd>
</dl>
<p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
<?php if (!$_order->getIsVirtual()): ?>
<div class="col2-set order-info-box">
    <div class="col-1">
        <div class="box">
            <div class="box-title">
                <h2><?php echo $this->__('Shipping Address') ?></h2>
            </div>
            <div class="box-content">
                <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
            </div>
        </div>
    </div>
    <div class="col-2">
        <div class="box">
            <div class="box-title">
                <h2><?php echo $this->__('Shipping Method') ?></h2>
            </div>
            <div class="box-content">
                <?php if ($_order->getShippingDescription()): ?>
                    <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
                <?php else: ?>
                    <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
<?php endif; ?>
<div class="col2-set order-info-box">
    <div class="col-1">
        <div class="box">
            <div class="box-title">
                <h2><?php echo $this->__('Billing Address') ?></h2>
            </div>
            <div class="box-content">
                <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
            </div>
        </div>
    </div>
    <div class="col-2">
        <div class="box box-payment">
            <div class="box-title">
                <h2><?php echo $this->__('Payment Method') ?></h2>
            </div>
            <div class="box-content">
                <?php echo $this->getPaymentInfoHtml() ?>
            </div>
        </div>
    </div>
</div>
<div class="col2-set order-info-box">
    <div class="col-1">
        <div class="box box-payment">
            <div class="box-title">
                <h2><?php echo $this->__('Invoice Information') ?></h2>
            </div>
            <?php
            $invoice_type=$_order->getBillType();
            $invoice_payable=$_order->getBillTitle();
            $invoice_content=$_order->getBillContent();
            ?>
            <div class="box-content">
                <table cellspacing="0" class="form-list">
                    <tbody>
                    <tr>
                        <td class="label" style="width:150px;"><label><?php echo $this->__('Invoice Type') ?></label></td>
                        <td class="value"><strong><?php echo $invoice_type;?></strong></td>
                    </tr>
                    <tr>
                        <td class="label"><label><?php echo $this->__('Invoices Payable') ?></label></td>
                        <td class="value"><strong><?php if($invoice_payable=='Units') echo $_order->getBillCompany();
                                else if($invoice_payable=='Personal') echo $_order->getCustomerFirstname();?></strong></td>
                    </tr>
                    <tr>
                        <td class="label"><label><?php echo $this->__('Invoice Content') ?></label></td>
                        <td class="value"><strong><?php echo $invoice_content;?></strong></td>
                    </tr>
                    <?php if($invoice_type=='VAT Invoice'):?>
                        <tr>
                            <td class="label"><label><?php echo $this->__('Taxpayer identification number') ?></label></td>
                            <td class="value"><strong><?php echo $_order->getBillTaxpayerId();?></strong></td>
                        </tr>
                        <tr>
                            <td class="label"><label><?php echo $this->__('Registered Address') ?></label></td>
                            <td class="value"><strong><?php echo $_order->getBillAddress();?></strong></td>
                        </tr>
                        <tr>
                            <td class="label"><label><?php echo $this->__('Registered Telephone') ?></label></td>
                            <td class="value"><strong><?php echo $_order->getBillPhone();?></strong></td>
                        </tr>
                        <tr>
                            <td class="label"><label><?php echo $this->__('Open an account with the bank') ?></label></td>
                            <td class="value"><strong><?php echo $_order->getBillBank();?></strong></td>
                        </tr>
                        <tr>
                            <td class="label"><label><?php echo $this->__('Bank account') ?></label></td>
                            <td class="value"><strong><?php echo $_order->getBillAccount();?></strong></td>
                        </tr>
                    <?php endif;?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

